<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>jouyouyun&#39;s blog</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="jouyouyun" /><meta name="description" content="jouyouyun&#39;s blog" /><meta name="keywords" content="jouyouyun, Hugo, theme, even" />






<meta name="generator" content="Hugo 0.54.0 with even 4.0.0" />


<link rel="canonical" href="https://jouyouyun.github.io/" />
  <link href="https://jouyouyun.github.io/index.xml" rel="alternate" type="application/rss+xml" title="jouyouyun&#39;s blog" />
  <link href="https://jouyouyun.github.io/index.xml" rel="feed" type="application/rss+xml" title="jouyouyun&#39;s blog" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">


<link href="/dist/even.93844dae.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="jouyouyun&#39;s blog" />
<meta property="og:description" content="jouyouyun&#39;s blog" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://jouyouyun.github.io/" />

<meta property="og:updated_time" content="2018-08-27T21:38:21&#43;08:00"/>

<meta itemprop="name" content="jouyouyun&#39;s blog">
<meta itemprop="description" content="jouyouyun&#39;s blog">

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="jouyouyun&#39;s blog"/>
<meta name="twitter:description" content="jouyouyun&#39;s blog"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">jouyouyun</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/post/">
        <li class="mobile-menu-item">Archives</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">Tags</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">Categories</li>
      </a>
  </ul>
</nav>
  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">jouyouyun</a>
</div>

<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/post/">Archives</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">Tags</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">Categories</a>
      </li>
  </ul>
</nav>
    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <section id="posts" class="posts">
    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/linux-time-standard/">Linux 时间标准</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-08-27 </span>
      <div class="post-category">
          <a href="/categories/blog/"> BLOG </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="系统如何设置时间">系统如何设置时间</h2>

<ol>
<li>开机时根据硬件时钟来设置系统时钟.</li>
<li>如果开启了 <code>NTP</code> 服务, 会根据网络时间来校正系统时钟，确保时间准确.</li>
<li>关机时会根据系统时钟来设置硬件时钟(<code>localtime</code> 标准除外).</li>
</ol>

<h3 id="时钟">时钟</h3>

<ul>
<li>硬件时钟: 即实时时钟 <code>RTC</code> 或 <code>CMOS</code> 时钟, 仅能保存年、月、日、时、分、秒这些时间数值，无法保存时间标准和是否使用夏令时调节.</li>
<li>系统时钟: 即软件时间, 与硬件时间分别维护，保存了时间、时区和夏令时设置.初始系统时钟是从硬件时间计算得来，计算时会考虑 <code>/etc/adjtime</code> 的设置.</li>
<li><code>/etc/adjtime</code>: 这个文件中记录了时区标准和时间偏移, 根据硬件时钟设置系统时间和设置硬件时钟都会根据时间偏移来计算的.所有的时钟都是有误差的，但是一般有固定的偏移, 这种于基值的差称为“time skew”或“时间偏移”.</li>
</ul>
    </div>
    <div class="read-more">
      <a href="/post/linux-time-standard/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/fixed-superblock/">修复 superblock</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-07-27 </span>
      <div class="post-category">
          <a href="/categories/blog/"> BLOG </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <p>本周去某公司调试系统，他们硬件测试部分送来了一台系统无法进入的机器，他们也不知道怎么弄得，让我看下是系统原因还是 <code>SSD</code> 硬件有问题。</p>

<p>拿到机器开机后，没有正常的进入系统，直接进入了 <code>initramfs mode</code> 并有 <code>filesystem invalid superblock checksum error</code> 的错误提示，遂告诉他们是系统的 <code>filesystem</code> 挂了，然后开始查找修复方法，最后找到了方法并修复了机器，在此记录一下。</p>

<h2 id="修复方法">修复方法</h2>

<p>下面的命令都是在 <code>initramfs shell</code> 中执行的。</p>

<h3 id="先确定你系统所在的分区">先确定你系统所在的分区</h3>

<p>可以执行 <code>lsblk</code> 来查看分区信息，然后确定，假如是 <code>/dev/sdaX</code></p>
    </div>
    <div class="read-more">
      <a href="/post/fixed-superblock/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/restful-introduction/">RESTful 简介</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-05-10 </span>
      <div class="post-category">
          <a href="/categories/blog/"> BLOG </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="简介">简介</h2>

<p><code>RESTful</code> 即表现层状态转换，是一种设计风格，不是标准。其要点如下：</p>

<ul>
<li><p>资源由 <code>URI</code> 来指定</p>

<p>每个资源都有与之对应的 <code>URI=，一个 =URI</code> 只能对应一种资源，但一种资源可以对应多个 <code>URI</code> 不同的分类方法)。</p></li>

<li><p>对资源的操作对应到 <code>HTTP</code> 协议提供的方法</p>

<p>如增删改查等操作，对应 <code>HTTP</code> 协议的 <code>POST, DELETE, PUT, GET</code> 等方法</p></li>

<li><p>资源的表现形式通常广泛流行的协议和标准</p>

<p>如 <code>JSON, XML, HTML</code> 等格式，当然也可以是其它格式或者私有格式，但一定足够能描述自己</p></li>

<li><p>通过操作资源的表现形式来操作资源</p>

<p>通过修改表现形式再辅以 <code>HTTP</code> 协议的方法，应用就可以管理资源</p></li>

<li><p>以超媒体作为应用状态的引擎</p>

<p>资源相关操作的 <code>URI</code> 可附加在表现形式内，应用根据自身状态选择相应的 <code>URI</code> 来更改状态。</p>

<p>操作可以是 <code>URI</code> 外，也可以是一段代码，让应用执行。</p></li>
</ul>
    </div>
    <div class="read-more">
      <a href="/post/restful-introduction/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/git-rebase/">Git Rebase 回退</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-04-12 </span>
      <div class="post-category">
          <a href="/categories/blog/"> BLOG </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <p>在开发新功能或修复 <code>bug</code> 时，一般需要新建一个分支，然后在它之上进行开发。在多人协同开发时，经常会同时修改相同的分支或相同的文件，这时就需要进行 <code>rebase</code> 操作在提交你的代码之前。</p>

<p>但有时 <code>rebase</code> 会带来不想要的提交，或处理冲突时误操作执行了 <code>git rebase --skip</code> 。此时就想要回退到之前的提交，恢复自己的数据， <code>reflog</code> 就可以帮助你完成数据恢复。</p>

<h2 id="reflog">reflog</h2>

<p>当你工作时，=Git= 会在你每次修改了 <code>HEAD</code> 时悄悄地将改动记录下来。当你提交或修改分支时， <code>reflog</code> 就会更新。通过 <code>git reflog</code> 命令可以查看当前的状态：</p>
    </div>
    <div class="read-more">
      <a href="/post/git-rebase/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    <article class="post">
  <header class="post-header">
    <h1 class="post-title"><a class="post-link" href="/post/cups-notes/">CUPS 资料</a></h1>
    <div class="post-meta">
      <span class="post-time"> 2018-04-08 </span>
      <div class="post-category">
          <a href="/categories/note/"> NOTE </a>
          </div>
    </div>
  </header>
  
  <div class="post-content">
    <div class="post-summary">
      <h2 id="installation">Installation</h2>

<p><code>sudo apt install cups ghostscript gsfonts</code></p>

<h2 id="driver">Driver</h2>

<ul>
<li><p>gutenprint</p>

<p>一组质量非常好的驱动集合，支持的目标机型包括 <code>Canon, Epson, Lexmark, Sony, Olympus</code> ；以及配合 <code>CUPS/GhostSscript/Foomatic/GIMP</code> 使用的 <code>PCL printers</code> 。</p>

<p>安装包: <code>cups-driver-gutenprint gimp-gutenprint ijsgutenprint printer-driver-gutenprint</code></p></li>

<li><p>foomatic</p>

<p><code>Foomatic</code> 是一个基于数据库的，集成自由软件打印机驱动和脱机打印程序的系统。</p>

<p>安装包: <code>foomatic-db foomatic-db-engine foomatic-db-compressed-ppds foomatic-db-gutenprint foomatic-filters</code> 以及 <code>foomatic-db-nonfree</code></p></li>
</ul>
    </div>
    <div class="read-more">
      <a href="/post/cups-notes/" class="read-more-link">阅读更多</a>
    </div>
  </div>
</article>

    </section>
  
  <nav class="pagination">
    <a class="prev" href="/page/4/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text">上一页</span>
      </a>
    <a class="next" href="/page/6/">
        <span class="next-text">下一页</span>
        <i class="iconfont icon-right"></i>
      </a>
  </nav>
        </div>
        

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:jouyouwen717@gmail.com" class="iconfont icon-email" title="email"></a>
      <a href="https://twitter.com/jouyouyun" class="iconfont icon-twitter" title="twitter"></a>
      <a href="https://github.com/jouyouyun" class="iconfont icon-github" title="github"></a>
  <a href="https://jouyouyun.github.io/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  

  <span class="copyright-year">
    &copy; 
    2014 - 
    2019
    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">jouyouyun</span>
  </span>
</div>
    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>
<script type="text/javascript" src="/dist/even.ece58db6.min.js"></script>








</body>
</html>
